﻿@model Lokad.Cloud.Console.WebRole.Models.Overview.OverviewModel
@{ ViewBag.Title = "Lokad.Cloud Administration Console - Overview"; }

<h1>Lokad.Cloud Hosted Services Overview</h1>
<p>The following Lokad.Cloud Hosted Services have been discovered in your Windows Azure subscription.</p>

@foreach (var item in Model.HostedServices) {
	<table class="table">
	<tr>
		<th style="width: 180px;"><b>@item.ServiceName</b></th>
		<th style="width: 500px;"><b>@item.ServiceLabel</b></th>
	</tr>
	@if (!String.IsNullOrEmpty(item.Description)) {
		<tr>
			<td colspan="2"><em>@item.Description</em></td>
		</tr>
	}
	<tr>
		<td style="text-align: right;">Storage Account:</td>
		<td><code>@item.StorageAccountName</code>, with key <code>@item.StorageAccountKeyPrefix...</code></td>
	</tr>
	<tr>
		<td style="text-align: right;">Deployments:</td>
		<td>
		@foreach (var deployment in item.Deployments) {
			@: @Html.OkCancelIcon(deployment.IsRunning) @deployment.Slot @if (deployment.IsTransitioning) { <b>UPDATING</b> } with <b>@deployment.InstanceCount Worker Instances</b>: <em>@deployment.DeploymentLabel</em><br/>
		}
		</td>
	</tr>
	</table>
	<p>&nbsp;</p>
}
